#include "stdio.h"
#include <fcntl.h>

#define FLASH_SIZE 8*1024*1024
#define DEVNAME "/dev/dump"
int main(){
	int fd,i;
	FILE *bak;
	char buf[1024];
	fd=open(DEVNAME,O_RDWR);
	bak=fopen("/mnt/nfs/bak.bin","w+");
	printf ("%x/n",bak);
	for (i=0;i<FLASH_SIZE/1024 ;i++ )
	{
		read(fd,buf,1024,1);
	fwrite(buf,1024,1,bak);
	}
	close (fd);
	fclose(bak);
	return 0;
}
